/*
 * @Copyright: Copyright (c) 2030 吴周海
 * @Author: wzh200x@126.com
 * @Date: 2025-10-09 14:51:47
 * @LastEditors: wzh200x@126.com
 * @LastEditTime: 2025-10-09 14:55:44
 * @FilePath: \goWebServer\goGameWebServer\internal\interfaces\interface_entity_model.go
 * @Description: 文件功能描述
 */
package interfaces

import (
	"goGameWebServer/internal/defines/dataType"

	"github.com/gogf/gf/v2/container/gmap"
)

type IEntityModelData interface {
	Reset()
}

type IBaseModel interface {
	IsPersistent() bool
	Reset()
	SetEntityDBID(entityDBID dataType.TypeDataBaseId)
	GetEntityDBID() dataType.TypeDataBaseId
}

type IEntityModel interface {
	IBaseModel
	Create() error
	LoadEntityDataFromDB(records interface{}) error
	UpdateEntityData(isSyncToDB bool) error
	SetEntityData(d IEntityModelData)
	GetEntityData() IEntityModelData
	SyncEntityDataToDB() error
	SaveEntityDataToDB() error
}

type IEntityModuleModel interface {
	IBaseModel
	IsSingleData() bool
	SetModuleSingleDataDBID(dbid dataType.TypeDataBaseId)
	SetUpdateSingleData()
	SetModelData(dbId dataType.TypeDataBaseId, data interface{})
	GetModelData(dbId dataType.TypeDataBaseId) interface{}
	GetModelDatas() *gmap.IntAnyMap
	SetModelDataUpdate(dbId dataType.TypeDataBaseId)
	SyncModuleToDB() error
	UpdateDataModule(dbId dataType.TypeDataBaseId, isSyncToDB bool) error
	SaveModuleToDB() error
	LoadModule() error
}
